import { useState } from 'react';
import { WithCounter } from './WithCounter';
const HoverCounter = (props: any) => {
  // 划过次数，是组件状体
  // const [count, setCount] = useState(0);
  // const incrementCount = () => {
  //   setCount(count + 1);
  // };
  return (
    <div>
      <h1 onMouseLeave={props.incrementCount}>鼠标滑过了{props.count}次</h1>
    </div>
  );
};

export default WithCounter(HoverCounter);
